import os
from typing import Optional
from ..config import OUTPUT_DIR
from ..utils.logger import setup_logger

logger = setup_logger('download_service')

class DownloadService:
    @staticmethod
    def get_file_path(filename: str) -> Optional[str]:
        """获取文件路径"""
        try:
            file_path = os.path.join(OUTPUT_DIR, filename)
            if not os.path.exists(file_path):
                logger.error(f"文件不存在: {file_path}")
                return None
            return file_path
        except Exception as e:
            logger.error(f"获取文件路径失败: {str(e)}")
            return None 